package Controller.Eboard;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.eboardBean;
import Dao.eboardDao;

public class EboardupdatelistContoller implements Controller {
	private eboardDao dao;
	public void setDao(eboardDao dao){
		this.dao = dao;
	}

	@Override
	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse arg1) throws Exception {
		eboardBean bean = new eboardBean();
		Integer eb_no = Integer.parseInt(request.getParameter("eb_no"));
		
		System.out.println(eb_no+"업데이트 리스트");
	
		bean.setEb_no(eb_no);
		
		eboardBean eboardupdatelist = dao.geteboardupdatelist(bean);
		String eb_context = eboardupdatelist.getEb_context();
		
		eb_context = eb_context.replace("<br>","\r\n");
		eboardupdatelist.setEb_context(eb_context);
		ModelAndView mav = new ModelAndView();
		mav.addObject("up​​datelist", eboardupdatelist);
		mav.setViewName("eboardupdatelist");
		return mav;
		
	}
	
}
